const store = {
  state: {
    num: 0
  },
  //存放同步
  actions: {
    increment(newState: { num: number }) {
      newState.num++
    },
    decrement(newState: { num: number }, action: { type: string, value: number }) {
      newState.num --
    }
  },
  //存放异步
  asyncActions: {
    asyncAdd1(dispatch:Function) {
      setTimeout(() => {
        dispatch({ type: 'add1' })
      }, 1000)
    }
  }
}


export default store